<?php
	//header('content-type: text/html; charset=utf-8');
    class DBLink{
        //连接数据库
        function getConnect(){
            $serverName = "localhost";
            $dbuserName = "root";
            $dbPassword = "112233";
            $dbName = "sms";
            $conn=mysqli_connect($serverName ,$dbuserName,$dbPassword,$dbName);
            if (!$conn) {
                die("连接失败：".mysqli_connect_error());
            }
            return $conn;
        }
        //执行SQL(增、删、查、改)
        function query($sql,$conn){
            $result=mysqli_query($conn,$sql);
            return $result;
        }
        function close($conn){
            mysqli_close($conn);
        }
    }
?>
